<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>        
        *{
            list-style: none;
            box-sizing: border-box;
            margin: 0%;
            padding: 0%;
        }
        html,body{
            height: 100%;
            width: 100%;
            justify-content: center;
        }
        ul{
            margin-top: 50px;
            background-color: antiquewhite;
            border: 2px solid black;
            /* 初始高度设置为25px（只显示第一个选项），后面被下方height:25px覆盖 */
            height: 100px; 
            width: 100px;
            overflow: hidden;
            /* 最终高度 */
            height: 25px;
        }
        ul:hover{
            height: 100px;
        }
        li{
            height: 25px;
            width: 100%;
            text-align: center;
            line-height: 22px;
        }
        .inner{
            background-color: aqua;
        }
        .inner:hover{
            background-color: yellow;
            color: white;
            cursor: pointer;
        }
    </style>
</head>
<body>
    <ul>
        <li style="display: flex;justify-content: center;">请选择</li>
        <li class="inner">你好</li>
        <li class="inner">helloworld</li>
        <li class="inner">goodnight</li>
    </ul>
</body>
</html>